import 'dart:ui';

import 'package:flutter/material.dart';

class CYFontSize {
  static const double XSmall = 10; /// desc
  static const double Small = 12; /// body
  static const double Default = 13; /// body
  static const double Middle = 15; /// title
  static const double Large = 17; /// title
  static const double XLarge = 24; /// large
  static const double XXLarge = 34; /// large
}

class CYLineHeight {
  static const double Small = 14; /// body
  static const double Default = 16; /// body
  static const double Middle = 20; /// title
  static const double Large = 22; /// title
}

class CYMargin {
  static const double XSmall = 5;
  static const double Small = 8;
  static const double Middle = 12;
  static const double Default = 16;
  static const double Large = 32;
  static const double XLarge = 64;
}

class CYHeight {
  static const double Default = 28; /// 小型触控区域大小
  static const double Middle = 32; /// 中型触控区域大小
  static const double Large = 44; /// 触控区域大小
  static const double XLarge = 49; /// 按钮区域大小
}

class CYBorderRadius {
  static const double Large = 14;
  static const double Default = 8;
  static const double Small = 5;

  static borderRadius(double radius) {
    return BorderRadius.circular(radius);
  }
  static BorderRadius get largeBorderRadius => borderRadius(Large);
  static BorderRadius get defaultBorderRadius => borderRadius(Default);
  static BorderRadius get smallBorderRadius => borderRadius(Small);
}

class CYScreen {
  static double get width {
    return window.physicalSize.width / window.devicePixelRatio;
  }
  static double get height {
    return window.physicalSize.height / window.devicePixelRatio;
  } 
  static double getDpByDesignWidth(double _width, { double designWidth = 375}) {
    return width * _width / designWidth;
  }
}